package com.bootlever.framework.rmi.configuration;

import com.bootlever.framework.rmi.bean.BootleverRmiContainer;
import com.bootlever.framework.rmi.templates.RmiTemplate;
import org.aspectj.lang.annotation.After;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

@Configuration
public class RmiTemplateConfiguration {

    private static final Logger logger = LoggerFactory.getLogger(RmiTemplateConfiguration.class);

    @Autowired
    private BootleverRmiContainer bootleverRmiContainer;

   /* @Bean
    @ConditionalOnBean(BootleverRmiContainer.class)
    public RmiTemplate rmiTemplate(){
        logger.info("初始化rmiTemplate...");
        RmiTemplate rmiTemplate = new RmiTemplate(bootleverRmiContainer);
        return rmiTemplate;
    }*/

    @Bean
    public RmiRegistrarBean rmiRegistrarBean(){
        RmiRegistrarBean rmiRegistrarBean = new RmiRegistrarBean();
        return rmiRegistrarBean;
    }

}
